/*
 *
 * Created on 19 novembre 2007, 13:50
 */

package ihm;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.File;
import java.util.HashMap;
import java.util.Map.Entry;

import javax.swing.*;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
import javax.swing.filechooser.FileFilter;

import algorithme.Algorithme;
import algorithme.RecuitSimule;
import algorithme.RecuitSimule_PF;
import algorithme.VNS_PF;

import programme.Portefeuille;
import programme.PortefeuilleDeterministe;
import programme.Solution;
import programme.Variable;

/**
 *
 * @author  Anne-Sophie
 */
public class IhmInterface extends javax.swing.JFrame {
    
    File fichierDeDonnees;
    File fichierDeFrontiere;
    
    public IhmInterface() {
        initComponents();
    }
    
    private void initComponents() {
        buttonGroupDeterVNS = new ButtonGroup();
        buttonGroupDeterRS = new ButtonGroup();
        buttonGroupStochVNS = new ButtonGroup();
        buttonGroupStochRS = new ButtonGroup();
        jTabbedPane3 = new JTabbedPane();
        panelDeterministe = new  JPanel();
        jTabbedPane1 = new  JTabbedPane();
        panelDeterLagrange = new  JPanel();
        panelDeterLagrangeParam = new  JPanel();
        jLabel76 = new  JLabel();
        jLabel77 = new  JLabel();
        jLabel78 = new  JLabel();
        epsilonDeterRC = new  JTextField();
        kDeterRL = new  JTextField();
        rDeterRL = new  JTextField();
        deltaDeterRL = new  JTextField();
        calculDeterRL = new  JButton();
        jLabel81 = new  JLabel();
        jLabel82 = new  JLabel();
        panelDeterLagrangeRes = new  JPanel();
        jLabel72 = new  JLabel();
        rendementDeterRL = new  JTextField();
        jLabel83 = new  JLabel();
        jScrollPane12 = new  JScrollPane();
        listeYiDeterRL = new  JList();
        jLabel84 = new  JLabel();
        jScrollPane13 = new  JScrollPane();
        listeXiDeterRL = new  JList();
        jLabel85 = new  JLabel();
        panelDeterContinu = new  JPanel();
        panelDeterContinuRes = new  JPanel();
        jLabel65 = new  JLabel();
        rendementDeterRC = new  JTextField();
        jLabel66 = new  JLabel();
        jScrollPane10 = new  JScrollPane();
        listeYiDeterRC = new  JList();
        jLabel70 = new  JLabel();
        jScrollPane11 = new  JScrollPane();
        listeXiDeterRC = new  JList();
        jLabel71 = new  JLabel();
        panelDeterContinuParam = new  JPanel();
        jLabel73 = new  JLabel();
        jLabel74 = new  JLabel();
        jLabel75 = new  JLabel();
        epsilonDeterRL = new  JTextField();
        kDeterRC = new  JTextField();
        rDeterRC = new  JTextField();
        deltaDeterRC = new  JTextField();
        calculDeterRC = new  JButton();
        jLabel79 = new  JLabel();
        jLabel80 = new  JLabel();
        panelDeterRS = new  JPanel();
        panelDeterRSParam = new  JPanel();
        jLabel42 = new  JLabel();
        choixSolNulleDeterRS = new  JRadioButton();
        choixSolGloutonDeterRS = new  JRadioButton();
        jLabel43 = new  JLabel();
        jLabel44 = new  JLabel();
        jLabel45 = new  JLabel();
        epsilonDeterRS = new  JTextField();
        kDeterRS = new  JTextField();
        rDeterRS = new  JTextField();
        jLabel46 = new  JLabel();
        deltaDeterRS = new  JTextField();
        jLabel47 = new  JLabel();
        jLabel48 = new  JLabel();
        tempDeterRS = new  JTextField();
        nBPalierDeterRS = new  JTextField();
        nBIterDeterRS = new  JTextField();
        calculDeterRS = new  JButton();
        jLabel49 = new  JLabel();
        jLabel53 = new  JLabel();
        jLabel57 = new  JLabel();
        muDeterRS = new  JTextField();
        panelDeterRSRes = new  JPanel();
        jLabel50 = new  JLabel();
        rendementDeterRS = new  JTextField();
        jLabel52 = new  JLabel();
        jScrollPane6 = new  JScrollPane();
        listeYiDeterRS = new  JList();
        jLabel54 = new  JLabel();
        jScrollPane7 = new  JScrollPane();
        listeXiDeterRS = new  JList();
        jLabel51 = new  JLabel();
        panelDeterVNS = new  JPanel();
        panelDeterVNSParam = new  JPanel();
        jLabel55 = new  JLabel();
        choixSolNulleDeterVNS = new  JRadioButton();
        choixGloutonDeterVNS = new  JRadioButton();
        jLabel56 = new  JLabel();
        rDeterVNS = new  JTextField();
        jLabel59 = new  JLabel();
        jLabel60 = new  JLabel();
        condArretDeterVNS = new  JTextField();
        kMaxDeterVNS = new  JTextField();
        calculDeterVNS = new  JButton();
        jLabel64 = new  JLabel();
        kDeterVNS = new  JTextField();
        epsilonDeterVNS = new  JTextField();
        jLabel67 = new  JLabel();
        deltaDeterVNS = new  JTextField();
        jLabel68 = new  JLabel();
        jLabel69 = new  JLabel();
        panelDeterVNSRes = new  JPanel();
        jLabel58 = new  JLabel();
        rendementDeterVNS = new  JTextField();
        jLabel61 = new  JLabel();
        jScrollPane8 = new  JScrollPane();
        listeYiDeterVNS = new  JList();
        jLabel62 = new  JLabel();
        jScrollPane9 = new  JScrollPane();
        listeXiDeterVNS = new  JList();
        jLabel63 = new  JLabel();
        panelDeterApercu = new  JPanel();
        jLabel86 = new  JLabel();
        panelDeterApercuGraphe = new  JPanel();
        labelDeterApercu = new  JLabel();
        panelStochastique = new  JPanel();
        jTabbedPane2 = new  JTabbedPane();
        panelStochLagrange = new  JPanel();
        panelStochLagrangeParam = new  JPanel();
        jLabel36 = new  JLabel();
        rStochRL = new  JTextField();
        jLabel37 = new  JLabel();
        mStochRL = new  JTextField();
        jLabel38 = new  JLabel();
        alphaStochRL = new  JTextField();
        calculStochRL = new  JButton();
        panelStochLagrangeRes = new  JPanel();
        jLabel39 = new  JLabel();
        risqueStochRL = new  JTextField();
        jLabel40 = new  JLabel();
        varStochRL = new  JTextField();
        jLabel41 = new  JLabel();
        jScrollPane5 = new  JScrollPane();
        listeXiStochRL = new  JList();
        panelStochContinu = new  JPanel();
        panelStochContinuParam = new  JPanel();
        jLabel30 = new  JLabel();
        rStochRC = new  JTextField();
        jLabel31 = new  JLabel();
        mStochRC = new  JTextField();
        jLabel32 = new  JLabel();
        alphaStochRC = new  JTextField();
        calculStochRC = new  JButton();
        panelStochContinuRes = new  JPanel();
        jLabel33 = new  JLabel();
        risqueStochRC = new  JTextField();
        jLabel34 = new  JLabel();
        varStochRC = new  JTextField();
        jLabel35 = new  JLabel();
        jScrollPane4 = new  JScrollPane();
        listeXiStochRC = new  JList();
        panelStochRS = new  JPanel();
        panelStochRSParam = new  JPanel();
        jLabel7 = new  JLabel();
        choixSolNulleStochRS = new  JRadioButton();
        choixGloutonStochRS = new  JRadioButton();
        jLabel11 = new  JLabel();
        jLabel12 = new  JLabel();
        jLabel13 = new  JLabel();
        alphaStochRS = new  JTextField();
        mStochRS = new  JTextField();
        rStochRS = new  JTextField();
        jLabel14 = new  JLabel();
        muStochRS = new  JTextField();
        jLabel15 = new  JLabel();
        jLabel16 = new  JLabel();
        jLabel17 = new  JLabel();
        tempStochRS = new  JTextField();
        nBPalierStochRS = new  JTextField();
        nBIterStochRS = new  JTextField();
        calculStochRS = new  JButton();
        panelStochRSRes = new  JPanel();
        jLabel18 = new  JLabel();
        riskStochRS = new  JTextField();
        jLabel19 = new  JLabel();
        varStochRS = new  JTextField();
        jLabel20 = new  JLabel();
        jScrollPane2 = new  JScrollPane();
        listeXiStochRS = new  JList();
        panelStochVNS = new  JPanel();
        panelStochVNSRes = new  JPanel();
        jLabel21 = new  JLabel();
        risqueStochVNS = new  JTextField();
        jLabel22 = new  JLabel();
        varStochVNS = new  JTextField();
        jLabel23 = new  JLabel();
        jScrollPane3 = new  JScrollPane();
        listeXiStochVNS = new  JList();
        panelStochVNSParam = new  JPanel();
        jLabel24 = new  JLabel();
        choixSolNulleStochVNS = new  JRadioButton();
        choixGloutonStochVNS = new  JRadioButton();
        jLabel25 = new  JLabel();
        jLabel26 = new  JLabel();
        jLabel27 = new  JLabel();
        alphaStochVNS = new  JTextField();
        mStochVNS = new  JTextField();
        rStochVNS = new  JTextField();
        jLabel28 = new  JLabel();
        jLabel29 = new  JLabel();
        condArretStochVNS = new  JTextField();
        kMaxStochVNS = new  JTextField();
        calculStochVNS = new  JButton();
        panelStochScenario = new  JPanel();
        panelStochScenarioParam = new  JPanel();
        jLabel3 = new  JLabel();
        rStochAS  = new  JTextField();
        jLabel4 = new  JLabel();
        mStochAS = new  JTextField();
        jLabel5 = new  JLabel();
        alphaStochAS = new  JTextField();
        calculStochAS = new  JButton();
        panelStochScenarioRes = new  JPanel();
        jLabel8 = new  JLabel();
        nBScenarioStochAS = new  JTextField();
        jLabel9 = new  JLabel();
        jLabel10 = new  JLabel();
        risqueStochAS = new  JTextField();
        varStochAS = new  JTextField();
        jScrollPane1 = new  JScrollPane();
        listeXiStochAS = new  JList();
        jLabel6 = new  JLabel();
        panelStochApercu = new  JPanel();
        jLabel1 = new  JLabel();
        panelStochApercuGraphe = new  JPanel();
        jLabel2 = new  JLabel();
        jMenuBar1 = new  JMenuBar();
        menuFichier = new  JMenu();
        menuOuvrir = new  JMenuItem();
        menuQuitter = new  JMenuItem();
        menuAide = new  JMenu();
        menuAPropos = new  JMenu();
        
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        this.addWindowListener(new WindowListener(){
        	public void windowGainedFocus(WindowEvent e) {}

			public void windowOpened(WindowEvent arg0) {}

			public void windowClosing(WindowEvent arg0) {}

			public void windowClosed(WindowEvent arg0) {}

			public void windowIconified(WindowEvent arg0) {}

			public void windowDeiconified(WindowEvent arg0) {}

			public void windowActivated(WindowEvent arg0) {	
				if (fichierDeDonnees != null && fichierDeFrontiere != null){
					enableAll(true);
				}
			}

			public void windowDeactivated(WindowEvent arg0) {}
        });
        
        setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE);
        setTitle("Projet de programmation stochastique");
        jTabbedPane3.setTabPlacement( JTabbedPane.LEFT);
        jTabbedPane1.setTabPlacement( JTabbedPane.BOTTOM);
        jTabbedPane1.setNextFocusableComponent(jTabbedPane3);
        panelDeterLagrange.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterLagrangeParam.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterLagrangeParam.setBorder( BorderFactory.createTitledBorder("Paramètres de la relaxation Lagrangienne"));
        jLabel76.setText("Rendement désiré :\t\t                             R = ");
        panelDeterLagrangeParam.add(jLabel76, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 40, 270, -1));

        jLabel77.setText("Nb de titres à choisir :\t\t                         K = ");
        panelDeterLagrangeParam.add(jLabel77, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 270, -1));

        jLabel78.setText("Bornes pour les proportions des titres : 0 < ");
        panelDeterLagrangeParam.add(jLabel78, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 120, 260, -1));

        panelDeterLagrangeParam.add(epsilonDeterRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 120, 40, -1));

        panelDeterLagrangeParam.add(kDeterRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 80, 70, -1));

        panelDeterLagrangeParam.add(rDeterRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 40, 70, -1));

        panelDeterLagrangeParam.add(deltaDeterRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 120, 40, -1));

        calculDeterRL.setText("Lancer le calcul");
        calculDeterRL.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lancerCalculDeterLagrange(evt);
            }
        });

        panelDeterLagrangeParam.add(calculDeterRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 120, -1, -1));

        jLabel81.setText("<");
        panelDeterLagrangeParam.add(jLabel81, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 120, 20, -1));

        jLabel82.setText("< 1");
        panelDeterLagrangeParam.add(jLabel82, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 120, 30, -1));

        panelDeterLagrange.add(panelDeterLagrangeParam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 710, 180));

        panelDeterLagrangeRes.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterLagrangeRes.setBorder( BorderFactory.createTitledBorder("Résultats de la relaxation Lagrangienne"));
        jLabel72.setText("Valeur optimale trouvée ");
        panelDeterLagrangeRes.add(jLabel72, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 50, 140, 20));

        panelDeterLagrangeRes.add(rendementDeterRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 100, 70, -1));

        jLabel83.setText("Valeurs des yi : ");
        panelDeterLagrangeRes.add(jLabel83, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 110, -1));
        
        listeYiDeterRL.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane12.setViewportView(listeYiDeterRL);

        panelDeterLagrangeRes.add(jScrollPane12, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 30, 100, 120));

        jLabel84.setText("Valeurs des xi : ");
        panelDeterLagrangeRes.add(jLabel84, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 30, 110, -1));

        listeXiDeterRL.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane13.setViewportView(listeXiDeterRL);

        panelDeterLagrangeRes.add(jScrollPane13, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 30, 100, 120));

        jLabel85.setText("pour le rendement : ");
        panelDeterLagrangeRes.add(jLabel85, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 70, -1, -1));

        panelDeterLagrange.add(panelDeterLagrangeRes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 200, 710, 170));

        jTabbedPane1.addTab("Relaxation Lagrangienne", panelDeterLagrange);

        panelDeterContinu.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterContinuRes.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterContinuRes.setBorder( BorderFactory.createTitledBorder("Résultats de la relaxation continue"));
        jLabel65.setText("Valeur optimale trouvée ");
        panelDeterContinuRes.add(jLabel65, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 50, 140, 20));

        panelDeterContinuRes.add(rendementDeterRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 100, 70, -1));

        jLabel66.setText("Valeurs des yi : ");
        panelDeterContinuRes.add(jLabel66, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 110, -1));

        listeYiDeterRC.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane10.setViewportView(listeYiDeterRC);

        panelDeterContinuRes.add(jScrollPane10, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 30, 100, 120));

        jLabel70.setText("Valeurs des xi : ");
        panelDeterContinuRes.add(jLabel70, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 30, 110, -1));

        listeXiDeterRC.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane11.setViewportView(listeXiDeterRC);

        panelDeterContinuRes.add(jScrollPane11, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 30, 100, 120));

        jLabel71.setText("pour le rendement : ");
        panelDeterContinuRes.add(jLabel71, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 70, -1, -1));

        panelDeterContinu.add(panelDeterContinuRes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 200, 710, 170));

        panelDeterContinuParam.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterContinuParam.setBorder( BorderFactory.createTitledBorder("Paramètres de la relaxation continue"));
        jLabel73.setText("Rendement désiré :\t\t                             R = ");
        panelDeterContinuParam.add(jLabel73, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 40, 270, -1));

        jLabel74.setText("Nb de titres à choisir :\t\t                         K = ");
        panelDeterContinuParam.add(jLabel74, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 270, -1));

        jLabel75.setText("Bornes pour les proportions des titres : 0 < ");
        panelDeterContinuParam.add(jLabel75, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 120, 260, -1));

        panelDeterContinuParam.add(epsilonDeterRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 120, 40, -1));

        panelDeterContinuParam.add(kDeterRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 80, 70, -1));

        panelDeterContinuParam.add(rDeterRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 40, 70, -1));

        panelDeterContinuParam.add(deltaDeterRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 120, 40, -1));

        calculDeterRC.setText("Lancer le calcul");
        calculDeterRC.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lancerCalculDeterContinue(evt);
            }
        });

        panelDeterContinuParam.add(calculDeterRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 120, -1, -1));

        jLabel79.setText("<");
        panelDeterContinuParam.add(jLabel79, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 120, 20, -1));

        jLabel80.setText("< 1");
        panelDeterContinuParam.add(jLabel80, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 120, 30, -1));

        panelDeterContinu.add(panelDeterContinuParam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 710, 170));

        jTabbedPane1.addTab("Relaxation Continue", panelDeterContinu);

        panelDeterRS.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterRSParam.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterRSParam.setBorder( BorderFactory.createTitledBorder("Paramètres du recuit simulé"));
        jLabel42.setText("Solution initiale : ");
        panelDeterRSParam.add(jLabel42, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 120, -1));

        buttonGroupDeterRS.add(choixSolNulleDeterRS);
        choixSolNulleDeterRS.setText("Solution nulle");
        choixSolNulleDeterRS.setBorder( BorderFactory.createEmptyBorder(0, 0, 0, 0));
        choixSolNulleDeterRS.setMargin(new java.awt.Insets(0, 0, 0, 0));
        choixSolNulleDeterRS.setSelected(true);
        panelDeterRSParam.add(choixSolNulleDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 30, -1, -1));

        buttonGroupDeterRS.add(choixSolGloutonDeterRS);
        choixSolGloutonDeterRS.setText("Utilisation de l'algorithme glouton");
        choixSolGloutonDeterRS.setBorder( BorderFactory.createEmptyBorder(0, 0, 0, 0));
        choixSolGloutonDeterRS.setMargin(new java.awt.Insets(0, 0, 0, 0));
        panelDeterRSParam.add(choixSolGloutonDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 30, -1, -1));

        jLabel43.setText("Rendement désiré :\t\t                             R = ");
        panelDeterRSParam.add(jLabel43, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, 270, -1));

        jLabel44.setText("Nb de titres à choisir :\t\t                         K = ");
        panelDeterRSParam.add(jLabel44, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 110, 270, -1));

        jLabel45.setText("Bornes pour les proportions des titres : 0 < ");
        panelDeterRSParam.add(jLabel45, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 150, 260, -1));

        panelDeterRSParam.add(epsilonDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 150, 40, -1));

        panelDeterRSParam.add(kDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 110, 70, -1));

        panelDeterRSParam.add(rDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 70, 70, -1));

        jLabel46.setText("Nb de paliers : ");
        panelDeterRSParam.add(jLabel46, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 110, 170, -1));

        panelDeterRSParam.add(deltaDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 150, 40, -1));

        jLabel47.setText("Nb d'itérations internes : ");
        panelDeterRSParam.add(jLabel47, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 150, 170, -1));

        jLabel48.setText("Température initiale : ");
        panelDeterRSParam.add(jLabel48, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 70, 170, -1));

        panelDeterRSParam.add(tempDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 70, 70, -1));

        panelDeterRSParam.add(nBPalierDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 110, 70, -1));

        panelDeterRSParam.add(nBIterDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 150, 70, -1));

        calculDeterRS.setText("Lancer le calcul");
        calculDeterRS.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lancerCalculDeterRS(evt);
            }
        });

        panelDeterRSParam.add(calculDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 190, -1, -1));

        jLabel49.setText("<");
        panelDeterRSParam.add(jLabel49, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 150, 20, -1));

        jLabel53.setText("< 1");
        panelDeterRSParam.add(jLabel53, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 150, 30, -1));

        jLabel57.setText("Fonction de décroissance, g(t) = mu * t; 0,85 < mu < 0,95; mu = ");
        panelDeterRSParam.add(jLabel57, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 190, 370, -1));

        panelDeterRSParam.add(muDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 190, 70, -1));

        panelDeterRS.add(panelDeterRSParam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 710, 230));

        panelDeterRSRes.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterRSRes.setBorder( BorderFactory.createTitledBorder("Résultats du recuit simulé"));
        jLabel50.setText("Valeur optimale trouvée ");
        panelDeterRSRes.add(jLabel50, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 30, 140, 20));

        panelDeterRSRes.add(rendementDeterRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 80, 70, -1));

        jLabel52.setText("Valeurs des yi : ");
        panelDeterRSRes.add(jLabel52, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, 110, -1));

        listeYiDeterRS.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane6.setViewportView(listeYiDeterRS);

        panelDeterRSRes.add(jScrollPane6, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 20, 100, 80));

        jLabel54.setText("Valeurs des xi : ");
        panelDeterRSRes.add(jLabel54, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 20, 110, -1));

        listeXiDeterRS.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane7.setViewportView(listeXiDeterRS);

        panelDeterRSRes.add(jScrollPane7, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 20, 100, 80));

        jLabel51.setText("pour le rendement : ");
        panelDeterRSRes.add(jLabel51, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 50, -1, -1));

        panelDeterRS.add(panelDeterRSRes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 250, 710, 120));

        jTabbedPane1.addTab("Recuit Simulé", panelDeterRS);

        panelDeterVNS.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterVNSParam.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterVNSParam.setBorder( BorderFactory.createTitledBorder("Paramètres du VNS"));
        jLabel55.setText("Solution initiale : ");
        panelDeterVNSParam.add(jLabel55, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 120, -1));

        buttonGroupDeterVNS.add(choixSolNulleDeterVNS);
        choixSolNulleDeterVNS.setSelected(true);
        choixSolNulleDeterVNS.setText("Solution nulle");
        choixSolNulleDeterVNS.setBorder( BorderFactory.createEmptyBorder(0, 0, 0, 0));
        choixSolNulleDeterVNS.setMargin(new java.awt.Insets(0, 0, 0, 0));
        panelDeterVNSParam.add(choixSolNulleDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 30, -1, -1));

        buttonGroupDeterVNS.add(choixGloutonDeterVNS);
        choixGloutonDeterVNS.setText("Utilisation de l'algorithme glouton");
        choixGloutonDeterVNS.setBorder( BorderFactory.createEmptyBorder(0, 0, 0, 0));
        choixGloutonDeterVNS.setMargin(new java.awt.Insets(0, 0, 0, 0));
        panelDeterVNSParam.add(choixGloutonDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 30, -1, -1));

        jLabel56.setText("Rendement désiré :\t\t                             R = ");
        panelDeterVNSParam.add(jLabel56, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, 270, -1));

        panelDeterVNSParam.add(rDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 70, 70, -1));

        jLabel59.setText("Condition d'arrêt externe : ");
        panelDeterVNSParam.add(jLabel59, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 70, 190, -1));

        jLabel60.setText("Nb d'itérations internes (Kmax) : ");
        panelDeterVNSParam.add(jLabel60, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 110, 190, -1));

        panelDeterVNSParam.add(condArretDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 70, 70, -1));

        panelDeterVNSParam.add(kMaxDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 110, 70, -1));

        calculDeterVNS.setText("Lancer le calcul");
        calculDeterVNS.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lancerCalculDeterVNS(evt);
            }
        });

        panelDeterVNSParam.add(calculDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 150, -1, -1));

        jLabel64.setText("Nb de titres à choisir :\t\t                         K = ");
        panelDeterVNSParam.add(jLabel64, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 110, 270, -1));

        panelDeterVNSParam.add(kDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 110, 70, -1));

        panelDeterVNSParam.add(epsilonDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 150, 40, -1));

        jLabel67.setText("<");
        panelDeterVNSParam.add(jLabel67, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 150, 20, -1));

        panelDeterVNSParam.add(deltaDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 150, 40, -1));

        jLabel68.setText("< 1");
        panelDeterVNSParam.add(jLabel68, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 150, 30, -1));

        jLabel69.setText("Bornes pour les proportions des titres : 0 < ");
        panelDeterVNSParam.add(jLabel69, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 150, 260, -1));

        panelDeterVNS.add(panelDeterVNSParam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 710, 210));

        panelDeterVNSRes.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterVNSRes.setBorder( BorderFactory.createTitledBorder("Résultats du VNS"));
        jLabel58.setText("Valeur optimale trouvée ");
        panelDeterVNSRes.add(jLabel58, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 30, 140, 20));

        panelDeterVNSRes.add(rendementDeterVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 80, 70, -1));

        jLabel61.setText("Valeurs des yi : ");
        panelDeterVNSRes.add(jLabel61, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, 110, -1));

        listeYiDeterVNS.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane8.setViewportView(listeYiDeterVNS);

        panelDeterVNSRes.add(jScrollPane8, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 20, 100, 100));

        jLabel62.setText("Valeurs des xi : ");
        panelDeterVNSRes.add(jLabel62, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 20, 110, -1));

        listeXiDeterVNS.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane9.setViewportView(listeXiDeterVNS);

        panelDeterVNSRes.add(jScrollPane9, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 20, 100, 100));

        jLabel63.setText("pour le rendement : ");
        panelDeterVNSRes.add(jLabel63, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 50, -1, -1));

        panelDeterVNS.add(panelDeterVNSRes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 230, 710, 140));

        jTabbedPane1.addTab("VNS", panelDeterVNS);

        panelDeterApercu.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel86.setText("Visualisation de la solution du problème déterministe trouvée par rapport à la frontière optimale");
        panelDeterApercu.add(jLabel86, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, 650, -1));

        panelDeterApercuGraphe.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelDeterApercuGraphe.setBackground(new java.awt.Color(204, 204, 255));
        labelDeterApercu.setText("Graphique représentant la courbe de la frontière optimale et la mise en évidence de notre solution");
        panelDeterApercuGraphe.add(labelDeterApercu, new org.netbeans.lib.awtextra.AbsoluteConstraints(29, 70, 590, -1));

        panelDeterApercu.add(panelDeterApercuGraphe, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, 650, 310));

        jTabbedPane1.addTab("Aperçu", panelDeterApercu);

        org.jdesktop.layout.GroupLayout panelDeterministeLayout = new org.jdesktop.layout.GroupLayout(panelDeterministe);
        panelDeterministe.setLayout(panelDeterministeLayout);
        panelDeterministeLayout.setHorizontalGroup(
            panelDeterministeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelDeterministeLayout.createSequentialGroup()
                .addContainerGap()
                .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 769, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(18, Short.MAX_VALUE))
        );
        panelDeterministeLayout.setVerticalGroup(
            panelDeterministeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelDeterministeLayout.createSequentialGroup()
                .addContainerGap()
                .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE)
                .addContainerGap())
        );
        jTabbedPane3.addTab("D\u00e9terministe", panelDeterministe);
        panelDeterministe.getAccessibleContext().setAccessibleParent(jTabbedPane3);

        jTabbedPane2.setTabPlacement( JTabbedPane.BOTTOM);
        panelStochLagrange.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochLagrangeParam.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochLagrangeParam.setBorder( BorderFactory.createTitledBorder("Paramètres de la relaxation Lagrangienne"));
        jLabel36.setText("Rendement désiré :\t\t                             R = ");
        panelStochLagrangeParam.add(jLabel36, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 40, 270, -1));

        panelStochLagrangeParam.add(rStochRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 40, 70, -1));

        jLabel37.setText("Nombre de scénario :\t\t                         M = ");
        panelStochLagrangeParam.add(jLabel37, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 270, -1));

        panelStochLagrangeParam.add(mStochRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 80, 70, -1));

        jLabel38.setText("Risque de perte max admissible :  Alpha = ");
        panelStochLagrangeParam.add(jLabel38, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 120, 270, -1));

        panelStochLagrangeParam.add(alphaStochRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 120, 70, -1));

        calculStochRL.setText("Lancer le calcul");
        calculStochRL.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lancerCalculStochLagrange(evt);
            }
        });

        panelStochLagrangeParam.add(calculStochRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 120, -1, -1));

        panelStochLagrange.add(panelStochLagrangeParam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 720, 180));

        panelStochLagrangeRes.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochLagrangeRes.setBorder( BorderFactory.createTitledBorder("Résultats de la relaxation Lagrangienne"));
        jLabel39.setText("Valeur optimale trouvée pour le risque : ");
        panelStochLagrangeRes.add(jLabel39, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 270, -1));

        panelStochLagrangeRes.add(risqueStochRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 50, 70, -1));

        jLabel40.setText("Valeur optimale trouvée pour la VaR :");
        panelStochLagrangeRes.add(jLabel40, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 90, 270, -1));

        panelStochLagrangeRes.add(varStochRL, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 90, 70, -1));

        jLabel41.setText("Valeurs des xi : ");
        panelStochLagrangeRes.add(jLabel41, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 30, 110, -1));

        listeXiStochRL.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane5.setViewportView(listeXiStochRL);

        panelStochLagrangeRes.add(jScrollPane5, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 30, 120, 110));

        panelStochLagrange.add(panelStochLagrangeRes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 200, 720, 170));

        jTabbedPane2.addTab("Relaxation Lagrangienne", panelStochLagrange);

        panelStochContinu.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochContinuParam.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochContinuParam.setBorder( BorderFactory.createTitledBorder("Paramètres de la relaxation continue"));
        jLabel30.setText("Rendement désiré :\t\t                             R = ");
        panelStochContinuParam.add(jLabel30, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 40, 270, -1));

        panelStochContinuParam.add(rStochRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 40, 70, -1));

        jLabel31.setText("Nombre de scénario :\t\t                         M = ");
        panelStochContinuParam.add(jLabel31, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 270, -1));

        panelStochContinuParam.add(mStochRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 80, 70, -1));

        jLabel32.setText("Risque de perte max admissible :  Alpha = ");
        panelStochContinuParam.add(jLabel32, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 120, 270, -1));

        panelStochContinuParam.add(alphaStochRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 120, 70, -1));

        calculStochRC.setText("Lancer le calcul");
        calculStochRC.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lancerCalculStochContinue(evt);
            }
        });

        panelStochContinuParam.add(calculStochRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 120, -1, -1));

        panelStochContinu.add(panelStochContinuParam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 720, 180));

        panelStochContinuRes.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochContinuRes.setBorder( BorderFactory.createTitledBorder("Résultats de la relaxation continue"));
        jLabel33.setText("Valeur optimale trouvée pour le risque : ");
        panelStochContinuRes.add(jLabel33, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 270, -1));

        panelStochContinuRes.add(risqueStochRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 50, 70, -1));

        jLabel34.setText("Valeur optimale trouvée pour la VaR :");
        panelStochContinuRes.add(jLabel34, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 90, 270, -1));

        panelStochContinuRes.add(varStochRC, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 90, 70, -1));

        jLabel35.setText("Valeurs des xi : ");
        panelStochContinuRes.add(jLabel35, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 30, 110, -1));

        listeXiStochRC.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane4.setViewportView(listeXiStochRC);

        panelStochContinuRes.add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 30, 120, 110));

        panelStochContinu.add(panelStochContinuRes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 200, 720, 170));

        jTabbedPane2.addTab("Relaxation Continue", panelStochContinu);

        panelStochRS.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochRSParam.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochRSParam.setBorder( BorderFactory.createTitledBorder("Paramètres du recuit simulé"));
        jLabel7.setText("Solution initiale : ");
        panelStochRSParam.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 120, -1));

        buttonGroupStochRS.add(choixSolNulleStochRS);
        choixSolNulleStochRS.setText("Solution nulle");
        choixSolNulleStochRS.setSelected(true);
        choixSolNulleStochRS.setBorder( BorderFactory.createEmptyBorder(0, 0, 0, 0));
        choixSolNulleStochRS.setMargin(new java.awt.Insets(0, 0, 0, 0));
        panelStochRSParam.add(choixSolNulleStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 30, -1, -1));

        buttonGroupStochRS.add(choixGloutonStochRS);
        choixGloutonStochRS.setText("Utilisation de l'algorithme glouton");
        choixGloutonStochRS.setBorder( BorderFactory.createEmptyBorder(0, 0, 0, 0));
        choixGloutonStochRS.setMargin(new java.awt.Insets(0, 0, 0, 0));
        panelStochRSParam.add(choixGloutonStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 30, -1, -1));

        jLabel11.setText("Rendement désiré :\t\t                             R = ");
        panelStochRSParam.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, 270, -1));

        jLabel12.setText("Nombre de scénario :\t\t                         M = ");
        panelStochRSParam.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 110, 270, -1));

        jLabel13.setText("Risque de perte max admissible :  Alpha = ");
        panelStochRSParam.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 150, 270, -1));

        panelStochRSParam.add(alphaStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 150, 70, -1));

        panelStochRSParam.add(mStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 110, 70, -1));

        panelStochRSParam.add(rStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 70, 70, -1));

        jLabel14.setText("Nb de paliers : ");
        panelStochRSParam.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 110, 190, -1));

        panelStochRSParam.add(muStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 190, 70, -1));

        jLabel15.setText("Nb d'itérations internes : ");
        panelStochRSParam.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 150, 170, -1));

        jLabel16.setText("Température initiale : ");
        panelStochRSParam.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 70, 180, -1));

        jLabel17.setText("Fonction de décroissance, g(t) = mu * t; 0,85 < mu < 0,95; mu = ");
        panelStochRSParam.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 190, 370, -1));

        panelStochRSParam.add(tempStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 70, 70, -1));

        panelStochRSParam.add(nBPalierStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 110, 70, -1));

        panelStochRSParam.add(nBIterStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 150, 70, -1));

        calculStochRS.setText("Lancer le calcul");
        calculStochRS.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lancerCalculStochRS(evt);
            }
        });

        panelStochRSParam.add(calculStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 190, -1, -1));

        panelStochRS.add(panelStochRSParam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 710, 240));

        panelStochRSRes.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochRSRes.setBorder( BorderFactory.createTitledBorder("Résultats du recuit simulé"));
        jLabel18.setText("Valeur optimale trouvée pour le risque : ");
        panelStochRSRes.add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 270, -1));

        panelStochRSRes.add(riskStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 30, 70, -1));

        jLabel19.setText("Valeur optimale trouvée pour la VaR :");
        panelStochRSRes.add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, 270, -1));

        panelStochRSRes.add(varStochRS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 70, 70, -1));

        jLabel20.setText("Valeurs des xi : ");
        panelStochRSRes.add(jLabel20, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 30, 110, -1));

        listeXiStochRS.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane2.setViewportView(listeXiStochRS);

        panelStochRSRes.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 20, 120, 80));

        panelStochRS.add(panelStochRSRes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 260, 710, 110));

        jTabbedPane2.addTab("Recuit simulé", panelStochRS);

        panelStochVNS.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochVNSRes.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochVNSRes.setBorder( BorderFactory.createTitledBorder("Résultats du VNS"));
        jLabel21.setText("Valeur optimale trouvée pour le risque : ");
        panelStochVNSRes.add(jLabel21, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 270, -1));

        panelStochVNSRes.add(risqueStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 50, 70, -1));

        jLabel22.setText("Valeur optimale trouvée pour la VaR :");
        panelStochVNSRes.add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 90, 270, -1));

        panelStochVNSRes.add(varStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 90, 70, -1));

        jLabel23.setText("Valeurs des xi : ");
        panelStochVNSRes.add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 30, 110, -1));

        listeXiStochVNS.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane3.setViewportView(listeXiStochVNS);

        panelStochVNSRes.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 20, 120, 110));

        panelStochVNS.add(panelStochVNSRes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 220, 710, 150));

        panelStochVNSParam.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochVNSParam.setBorder( BorderFactory.createTitledBorder("Paramètres du VNS"));
        jLabel24.setText("Solution initiale : ");
        panelStochVNSParam.add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 120, -1));

        buttonGroupStochVNS.add(choixSolNulleStochVNS);
        choixSolNulleStochVNS.setText("Solution nulle");
        choixSolNulleStochVNS.setSelected(true);
        choixSolNulleStochVNS.setBorder( BorderFactory.createEmptyBorder(0, 0, 0, 0));
        choixSolNulleStochVNS.setMargin(new java.awt.Insets(0, 0, 0, 0));
        panelStochVNSParam.add(choixSolNulleStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 30, -1, -1));

        buttonGroupStochVNS.add(choixGloutonStochVNS);
        choixGloutonStochVNS.setText("Utilisation de l'algorithme glouton");
        choixGloutonStochVNS.setBorder( BorderFactory.createEmptyBorder(0, 0, 0, 0));
        choixGloutonStochVNS.setMargin(new java.awt.Insets(0, 0, 0, 0));
        panelStochVNSParam.add(choixGloutonStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 30, -1, -1));

        jLabel25.setText("Rendement désiré :\t\t                             R = ");
        panelStochVNSParam.add(jLabel25, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, 270, -1));

        jLabel26.setText("Nombre de scénario :\t\t                         M = ");
        panelStochVNSParam.add(jLabel26, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 110, 270, -1));

        jLabel27.setText("Risque de perte max admissible :  Alpha = ");
        panelStochVNSParam.add(jLabel27, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 150, 270, -1));

        panelStochVNSParam.add(alphaStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 150, 70, -1));

        panelStochVNSParam.add(mStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 110, 70, -1));

        panelStochVNSParam.add(rStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 70, 70, -1));

        jLabel28.setText("Condition d'arrêt externe : ");
        panelStochVNSParam.add(jLabel28, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 70, 190, -1));

        jLabel29.setText("Nb d'itérations internes (Kmax) : ");
        panelStochVNSParam.add(jLabel29, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 110, 190, -1));

        panelStochVNSParam.add(condArretStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 70, 70, -1));

        panelStochVNSParam.add(kMaxStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 110, 70, -1));

        calculStochVNS.setText("Lancer le calcul");
        calculStochVNS.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lancerCalculStochVNS(evt);
            }
        });

        panelStochVNSParam.add(calculStochVNS, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 150, -1, -1));

        panelStochVNS.add(panelStochVNSParam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 710, 200));

        jTabbedPane2.addTab("VNS", panelStochVNS);

        panelStochScenario.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochScenarioParam.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochScenarioParam.setBorder( BorderFactory.createTitledBorder("Paramètres de l'analyse de scénarios"));
        jLabel3.setText("Rendement désiré :\t\t                             R = ");
        panelStochScenarioParam.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 40, 270, -1));

        panelStochScenarioParam.add(rStochAS , new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 40, 70, -1));

        jLabel4.setText("Nombre de scénario :\t\t                         M = ");
        panelStochScenarioParam.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 270, -1));

        panelStochScenarioParam.add(mStochAS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 80, 70, -1));

        jLabel5.setText("Risque de perte max admissible :  Alpha = ");
        panelStochScenarioParam.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 120, 270, -1));

        panelStochScenarioParam.add(alphaStochAS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 120, 70, -1));

        calculStochAS.setText("Lancer le calcul");
        calculStochAS.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lancerCalculStochAnalyse(evt);
            }
        });

        panelStochScenarioParam.add(calculStochAS, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 120, -1, -1));

        panelStochScenario.add(panelStochScenarioParam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 710, 170));

        panelStochScenarioRes.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochScenarioRes.setBorder( BorderFactory.createTitledBorder("Résultats de l'analyse de scénarios"));
        jLabel8.setText("Nombre de scénarios analysés : ");
        panelStochScenarioRes.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 40, 270, -1));

        panelStochScenarioRes.add(nBScenarioStochAS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 40, 70, -1));

        jLabel9.setText("Valeur optimale trouvée pour le risque : ");
        panelStochScenarioRes.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 270, -1));

        jLabel10.setText("Valeur optimale trouvée pour la VaR :");
        panelStochScenarioRes.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 120, 270, -1));

        panelStochScenarioRes.add(risqueStochAS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 80, 70, -1));

        panelStochScenarioRes.add(varStochAS, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 120, 70, -1));

        listeXiStochAS.setModel(new  AbstractListModel() {
            String[] strings = {};
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane1.setViewportView(listeXiStochAS);

        panelStochScenarioRes.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 40, 220, 100));

        jLabel6.setText("Valeurs des xi");
        panelStochScenarioRes.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 20, 110, -1));

        panelStochScenario.add(panelStochScenarioRes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 200, 710, 160));

        jTabbedPane2.addTab("Analyse de scénario", panelStochScenario);

        panelStochApercu.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setText("Visualisation de la solution du problème stochastique trouvée par rapport à la frontière optimale");
        panelStochApercu.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, 650, -1));

        panelStochApercuGraphe.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelStochApercuGraphe.setBackground(new java.awt.Color(204, 204, 255));
        jLabel2.setText("Graphique représentant la courbe de la frontière optimale et la mise en évidence de notre solution");
        panelStochApercuGraphe.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(29, 70, 590, -1));

        panelStochApercu.add(panelStochApercuGraphe, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, 650, 310));

        jTabbedPane2.addTab("Aperçu", panelStochApercu);

        org.jdesktop.layout.GroupLayout panelStochastiqueLayout = new org.jdesktop.layout.GroupLayout(panelStochastique);
        panelStochastique.setLayout(panelStochastiqueLayout);
        panelStochastiqueLayout.setHorizontalGroup(
            panelStochastiqueLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelStochastiqueLayout.createSequentialGroup()
                .addContainerGap()
                .add(jTabbedPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 769, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(18, Short.MAX_VALUE))
        );
        panelStochastiqueLayout.setVerticalGroup(
            panelStochastiqueLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelStochastiqueLayout.createSequentialGroup()
                .addContainerGap()
                .add(jTabbedPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE)
                .addContainerGap())
        );
        jTabbedPane3.addTab("Stochastique", panelStochastique);

        getContentPane().add(jTabbedPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 880, 440));
        
        menuFichier.setText("Fichier");
      
        menuOuvrir.setText("Ouvrir un fichier");
        menuOuvrir.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
            	trouverMenu(e);
            }
        });
        menuFichier.add(menuOuvrir);

        menuQuitter.setText("Quitter l'application");
        menuQuitter.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
            	trouverMenu(e);
            }
        });
        menuFichier.add(menuQuitter);
        menuQuitter.getAccessibleContext().setAccessibleName("");

        jMenuBar1.add(menuFichier);

        menuAide.setText("Aide");
        menuAide.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                afficherAide(evt);
            }
        });

        jMenuBar1.add(menuAide);

        menuAPropos.setText("A propos");
        menuAPropos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                afficherAPropos(evt);
            }
        });

        enableAll(false);
        jMenuBar1.add(menuAPropos);

        setJMenuBar(jMenuBar1);

        pack();
    }              

    public void trouverMenu(ActionEvent e) { 
    	Object Source = e.getSource();
    	 
    	if (Source == menuOuvrir){
    		fichierDeDonnees = null;
    		fichierDeFrontiere = null;
    		enableAll(false);
    		new Chargement(this).setVisible(true);	
    	} 
    	
    	if (Source == menuQuitter){
    		//fermeture de l'appli
	    	this.dispose();
    	}
    } 

    public void setFichierDeDonnees(File f){
    	fichierDeDonnees = f;
    }
    
    public void setFichierDeFrontiere(File f){
    	fichierDeFrontiere = f;
    }
    
    private void enableStochRL(boolean val){
        calculStochRL.setEnabled(val);
    }

    private void enableStochRC(boolean val){
        calculStochRC.setEnabled(val);
    }
    
    private void enableStochVNS(boolean val){
        calculStochVNS.setEnabled(val);
    }
    
    private void enableStochApercu(boolean val){
        panelStochApercuGraphe.setEnabled(val);
        panelStochApercu.setEnabled(val);
    }
    
    private void enableStochRS(boolean val){
	    calculStochRS.setEnabled(val);
    }

    private void enableStochAS(boolean val){
        calculStochAS.setEnabled(val);
    }

    private void enableAll(boolean val){
    	enableDeterministe(val);
    	enableStochastique(val);
    }
    
    private void enableStochastique(boolean val){
    	enableStochRL(val);
    	enableStochAS(val);
    	enableStochRS(val);
    	enableStochApercu(val);
    	enableStochVNS(val);
    	enableStochRC(val);
    }
    
    private void enableDeterministe(boolean val){
    	enableDeterRS(val);
    	enableDeterRL(val);
    	enableDeterRC(val);
    	enableDeterVNS(val);
    	enableDeterApercu(val);
    }
    
    private void enableDeterRS(boolean val){    
	    calculDeterRS.setEnabled(val);
    }
    
    private void enableDeterRL(boolean val){
        calculDeterRL.setEnabled(val);
    }

    private void enableDeterRC(boolean val){
        calculDeterRC.setEnabled(val);
    }
    
    private void enableDeterVNS(boolean val){
        calculDeterVNS.setEnabled(val);    	
    }
    
    private void enableDeterApercu(boolean val){
        panelDeterApercuGraphe.setEnabled(val);    
        panelDeterApercu.setEnabled(val);
        labelDeterApercu.setEnabled(val);
    }

    private boolean estEntierPositif(String val){
    	try {
			int i = Integer.parseInt(val);
			if (i<=0){
				return false;
			} 
		} catch (NumberFormatException e) {
			return false;
		}
		return true;
    }
    
    private boolean estDouble(String val){
    	try {
			Double i = Double.parseDouble(val);
			if (i<0){
				return false;
			} 
		} catch (NumberFormatException e) {
			return false;
		}
		return true;
    }
    
    private boolean estEntre0et1(String val){
    	try {
			Double i = Double.parseDouble(val);
			return ((i>=0) && (i<=1));
			} catch (NumberFormatException e) {
			return false;
		}
    }
    
    private void recupererParamStochRL(){
    	String v1 = rStochRL.getText();
    	String v2 = mStochRL.getText();
    	String v3 = alphaStochRL.getText();
    	
    	if (estDouble(v1) && estEntierPositif(v2) && estDouble(v3) && estEntre0et1(v3)){
    		//on peut recuperer les parametres, ils sont bons
    	}else{
    		JOptionPane.showMessageDialog(this, "R et alpha sont des doubles positifs, M un entier positif, et alpha doit être entre 0 et 1 : vérifiez vos paramètres.");
    	}
    }
    
    private void recupererParamStochRC(){
    	String v1 = rStochRC.getText();
    	String v2 = mStochRC.getText();
    	String v3 = alphaStochRC.getText();

    	if (estDouble(v1) && estEntierPositif(v2) && estDouble(v3) && estEntre0et1(v3)){
    		//on peut recuperer les parametres, ils sont bons
    	}else{
    		JOptionPane.showMessageDialog(this, "R et alpha sont des doubles positifs, M un entier positif, et alpha doit être entre 0 et 1 : vérifiez vos paramètres.");
    	}
    }

    private boolean muOK(String val){
    	try {
			Double i = Double.parseDouble(val);
			return ((i>0.85) && (i<0.95));
		} catch (NumberFormatException e) {
			return false;
		}
    }
    
    private void recupererParamStochRS(){
    	String v1 = rStochRS.getText();
    	String v2 = mStochRS.getText();
    	String v3 = alphaStochRS.getText();

    	if (estDouble(v1) && estEntierPositif(v2) && estDouble(v3) && estEntre0et1(v3)){
    	    String v4 = muStochRS.getText();
    	    String v5 = tempStochRS.getText();
    	    String v6 = nBPalierStochRS.getText();
    	    String v7 = nBIterStochRS.getText();
    		if (estDouble(v4) && muOK(v4) && estDouble(v5) && estEntierPositif(v6) && estEntierPositif(v7)){
    			//on peut recuperer les parametres, ils sont bons
    			/*ne pas oublier choixSolNulleStochRS et choixGloutonStochRS*/
    		}else{
    			JOptionPane.showMessageDialog(this, "Mu et la température sont des doubles positifs, le nombre de paliers et le nombre d'itération sont des entiers positifs, et mu doit être entre 0.85 et 0.95 : vérifiez vos paramètres.");
    		}
    	}else{
    		JOptionPane.showMessageDialog(this, "R et alpha sont des doubles positifs, M un entier positif, et alpha doit être entre 0 et 1 : vérifiez vos paramètres.");
    	}
    }
    
    private void recupererParamStochVNS(){
    	String v1 = rStochVNS.getText();
    	String v2 = mStochVNS.getText();
    	String v3 = alphaStochVNS.getText();

    	if (estDouble(v1) && estEntierPositif(v2) && estDouble(v3) && estEntre0et1(v3)){
    	    String v4 = condArretStochVNS.getText();
    	    String v5 = kMaxStochVNS.getText();
    	   
    		if (estEntierPositif(v4) && estEntierPositif(v5)){
    			//on peut recuperer les parametres, ils sont bons
    			/*ne pas oublier choixSolNulleStochRS et choixGloutonStochRS*/
    		}else{
    			JOptionPane.showMessageDialog(this, "les nombres d'itérations internes et externes sont des entiers positifs : vérifiez vos paramètres.");
    		}
    	}else{
    		JOptionPane.showMessageDialog(this, "R et alpha sont des doubles positifs, M un entier positif, et alpha doit être entre 0 et 1 : vérifiez vos paramètres.");
    	}
    }
    
    private boolean estDansLOrdre(String epsilon, String delta){
    	try {
			Double i = Double.parseDouble(epsilon);
			Double j = Double.parseDouble(delta);
			return (i<=j);
			} catch (NumberFormatException e) {
			return false;
		}
    }
    
    private void recupererParamStochAS(){
    	String v1 = rStochAS.getText();
    	String v2 = mStochAS.getText();
    	String v3 = alphaStochAS.getText();

    	if (estDouble(v1) && estEntierPositif(v2) && estDouble(v3) && estEntre0et1(v3)){
    		//on peut recuperer les parametres, ils sont bons
    	}else{
    		JOptionPane.showMessageDialog(this, "R et alpha sont des doubles positifs, M un entier positif, et alpha doit être entre 0 et 1 : vérifiez vos paramètres.");
    	}   	
    }    
    
    private void recupererParamDeterRL(){
    	String v1 = kDeterRL.getText();
    	String v2 = rDeterRL.getText();
    	String v3 = epsilonDeterRL.getText();
    	String v4 = deltaDeterRL.getText();
    	
    	if (estEntierPositif(v1) && estDouble(v2) && estDouble(v3) && estDouble(v4) && estEntre0et1(v3) && estEntre0et1(v4)){
    		if (estDansLOrdre(v3, v4)){
    			//on peut recuperer les parametres, ils sont bons
    		}else{
    			JOptionPane.showMessageDialog(this, "Les proportions des titres sont des doubles positifs, et 0 < epsilon < delta < 1 : vérifiez vos paramètres.");
    		}
    	}else{
    		JOptionPane.showMessageDialog(this, "R et alpha sont des doubles positifs, M un entier positif, et alpha doit être entre 0 et 1 : vérifiez vos paramètres.");
    	}  
    }
    
    private void recupererParamDeterRC(){
    	String v1 = kDeterRC.getText();
    	String v2 = rDeterRC.getText();
    	String v3 = epsilonDeterRC.getText();
    	String v4 = deltaDeterRC.getText();
    	
    	if (estEntierPositif(v1) && estDouble(v2) && estDouble(v3) && estDouble(v4) && estEntre0et1(v3) && estEntre0et1(v4)){
    		if (estDansLOrdre(v3, v4)){
    			//on peut recuperer les parametres, ils sont bons
    		}else{
    			JOptionPane.showMessageDialog(this, "Les proportions des titres sont des doubles positifs, et 0 < epsilon < delta < 1 : vérifiez vos paramètres.");
    		}
    	}else{
    		JOptionPane.showMessageDialog(this, "R et alpha sont des doubles positifs, M un entier positif, et alpha doit être entre 0 et 1 : vérifiez vos paramètres.");
    	}  
    }

    private void recupererParamDeterVNS(){
    	String v1 = kDeterVNS.getText();
    	String v2 = rDeterVNS.getText();
    	String v3 = epsilonDeterVNS.getText();
    	String v4 = deltaDeterVNS.getText();
    	
    	if (estEntierPositif(v1) && estDouble(v2) && estDouble(v3) && estDouble(v4) && estEntre0et1(v3) && estEntre0et1(v4)){
    		if (estDansLOrdre(v3, v4)){
    			String v5 = condArretDeterVNS.getText();
    			String v6 = kMaxDeterVNS.getText();
    			if (estEntierPositif(v5) && estEntierPositif(v6)){
	    			//on peut recuperer les parametres, ils sont bons
	    			/*ne pas oublier choixSolNulleDeterVNS et choixGloutonDeterVNS*/
    			}else{
    				JOptionPane.showMessageDialog(this, "Les nombres d'itérations internes et externes sont des entiers positifs : vérifiez vos paramètres.");
    			}
    		}else{
    			JOptionPane.showMessageDialog(this, "Les proportions des titres sont des doubles positifs, et 0 < epsilon < delta < 1 : vérifiez vos paramètres.");
    		}
    	}else{
    		JOptionPane.showMessageDialog(this, "R et alpha sont des doubles positifs, M un entier positif, et alpha doit être entre 0 et 1 : vérifiez vos paramètres.");
    	}
    }

    private void recupererParamDeterRS(){
    	String v1 = kDeterRS.getText();
    	String v2 = rDeterRS.getText();
    	String v3 = epsilonDeterRS.getText();
    	String v4 = deltaDeterRS.getText();
    	
    	if (estEntierPositif(v1) && estDouble(v2) && estDouble(v3) && estDouble(v4) && estEntre0et1(v3) && estEntre0et1(v4)){
    		if (estDansLOrdre(v3, v4)){
    			String v5 = nBPalierDeterRS.getText();
    			String v6 = nBIterDeterRS.getText();
    			if (estEntierPositif(v5) && estEntierPositif(v6)){
    				String v7 = muDeterRS.getText();
        			String v8 = tempDeterRS.getText();
    				if(estEntierPositif(v8) && estDouble(v7) && muOK(v7)){
		    			//on peut recuperer les parametres, ils sont bons
		    			/*ne pas oublier choixSolNulleDeterVNS et choixGloutonDeterVNS*/
    				}else{
    					JOptionPane.showMessageDialog(this, "La température est un entier positif et mu un double entre 0.85 et 0.95 : vérifiez vos paramètres.");
    				}
    			}else{
    				JOptionPane.showMessageDialog(this, "Les nombres d'itérations internes et externes sont des entiers positifs : vérifiez vos paramètres.");
    			}
    		}else{
    			JOptionPane.showMessageDialog(this, "Les proportions des titres sont des doubles positifs, et 0 < epsilon < delta < 1 : vérifiez vos paramètres.");
    		}
    	}else{
    		JOptionPane.showMessageDialog(this, "R et alpha sont des doubles positifs, M un entier positif, et alpha doit être entre 0 et 1 : vérifiez vos paramètres.");
    	}
    }

    private void afficherResStochRL(){
    	/*listeXiStochRL;
    	  risqueStochRL;
    	  varStochRL;*/
    }
    
    private void afficherResStochRC(){
    	  /*listeXiStochRC;
    	  risqueStochRC;
    	  varStochRC;*/
    }

    private void afficherResStochRS(){
    	  /*listeXiStochRS;
    	  riskStochRS;
    	  varStochRS;*/
    }
    
    private void afficherResStochVNS(){
    	  /*listeXiStochVNS;
    	  risqueStochVNS;
    	  varStochVNS;*/
    }
    
    private void afficherResStochAS(){
    	  /*listeXiStochAS;
    	  nBScenarioStochAS;
    	  risqueStochAS;
    	  varStochAS;
    	  */
    }    
    
    private void afficherResDeterRL(){
    	  /*panelDeterLagrangeRes;
    	  listeYiDeterRL;
    	  listeXiDeterRL;    
    	  rendementDeterRL;*/
    }
    
    private void afficherResDeterRC(){
    	  /*panelDeterContinuRes;
    	  listeYiDeterRC;
    	  listeXiDeterRC;
    	  rendementDeterRC;*/
    }

    private void afficherResDeterVNS(){
    	  /*panelDeterVNSRes;
    	  listeYiDeterVNS;
    	  listeXiDeterVNS;
    	  rendementDeterVNS;*/
    }

     private void afficherAPropos(java.awt.event.MouseEvent evt) {                                 
    	JOptionPane.showMessageDialog(this, "Projet de Programmation Stochastique, version 1.0\n\nLoïc Boutet\nAnne-Sophie Luypaerts\nMathieu Nancel\nJérémie Violas\n\n Année 2007-2008", "A propos", 1);
    }                                

    private void afficherAide(java.awt.event.MouseEvent evt) {                              
    	JOptionPane.showMessageDialog(this, "Pour obtenir de l'aide, lisez le manuel utilisateur", "Aide", 1);
    }                             

    private void lancerCalculStochAnalyse(java.awt.event.MouseEvent evt) {
    	enableAll(false);
    	recupererParamStochAS();
/////////////////////////////////////////
//    	ici appeler la fonction de calcul d'analyse de scenario stochastique
/////////////////////////////////////////
    	enableAll(true);
    }                                         

    private void lancerCalculStochVNS(java.awt.event.MouseEvent evt) {
    	enableAll(false);
    	recupererParamStochVNS();
/////////////////////////////////////////
//    	ici appeler la fonction de calcul de VNS stochastique
/////////////////////////////////////////
    	enableAll(true);
    }                                     

    private void lancerCalculStochRS(java.awt.event.MouseEvent evt) {
    	enableAll(false);
    	recupererParamStochRS();
/////////////////////////////////////////
//    	ici appeler la fonction de calcul du recuit simule stochastique
/////////////////////////////////////////
    	enableAll(true);
    }                                    

    private void lancerCalculStochContinue(java.awt.event.MouseEvent evt) {
    	enableAll(false);
    	recupererParamStochRC();
/////////////////////////////////////////
//    	ici appeler la fonction de calcul de la relaxation continue stochastique
/////////////////////////////////////////
    	enableAll(true);
    }                                          

    private void lancerCalculStochLagrange(java.awt.event.MouseEvent evt) {
    	enableAll(false);
    	recupererParamStochRL();
/////////////////////////////////////////
//    	ici appeler la fonction de calcul de la relaxation lagrangienne stochastique
/////////////////////////////////////////
    	enableAll(true);
    }                                          

    private void lancerCalculDeterVNS(java.awt.event.MouseEvent evt) {
    	enableAll(false);
    	recupererParamDeterVNS();
    	//appel
    	PortefeuilleDeterministe p = new PortefeuilleDeterministe(fichierDeDonnees.getAbsolutePath(), Integer.parseInt(kDeterVNS.getText()), Double.parseDouble(epsilonDeterVNS.getText()), Double.parseDouble(deltaDeterVNS.getText()), Double.parseDouble(rDeterVNS.getText()));
    	VNS_PF vns = new VNS_PF(p, true);
    	vns.lancer();
    	enableAll(true);
    }                                     

    
    private void afficherResDeterRS(double r, HashMap<Variable, Double> valeurs){
  	  rendementDeterRS.setText(Integer.toString((int)r));
  	  for (Entry<Variable,Double> entry : valeurs.entrySet()) {
  		  if (entry.getKey().getPrefixe().getNom().equals("Titres") ){
  			int size = listeXiDeterRS.getModel().getSize();  
	        String[] l = new String[size+1];
	        l[0]= ""+entry.getKey().getNumAbsolue()+" = "+  entry.getValue();	
	        for (int j=0; j<size; j++){
	        	l[j+1] = (String) listeXiDeterRS.getModel().getElementAt(j);
	        }
	        java.util.Arrays.sort(l) ;
	        listeXiDeterRS.setListData(l);	 
  		  }else{	 
  			int size = listeYiDeterRS.getModel().getSize();  
	        String[] l = new String[size+1];
	        l[0]= ""+entry.getKey().getNumAbsolue()+" = "+  entry.getValue();	
	        for (int j=0; j<size; j++){
	        	l[j+1] = (String) listeYiDeterRS.getModel().getElementAt(j);
	        }
	        java.util.Arrays.sort(l) ;
	        listeYiDeterRS.setListData(l);	
  		  }
  		  

			
	        
			
	}
  }
    
    private void lancerCalculDeterRS(java.awt.event.MouseEvent evt) {
    	enableAll(false);
    	recupererParamDeterRS();
    	//appel
    	PortefeuilleDeterministe p = new PortefeuilleDeterministe(fichierDeDonnees.getAbsolutePath(), Integer.parseInt(kDeterRS.getText()), Double.parseDouble(epsilonDeterRS.getText()), Double.parseDouble(deltaDeterRS.getText()), Double.parseDouble(rDeterRS.getText()));
    	System.out.println(Integer.parseInt(kDeterRS.getText())+" "+Double.parseDouble(epsilonDeterRS.getText())+" "+Double.parseDouble(deltaDeterRS.getText())+" "+Double.parseDouble(rDeterRS.getText()));
    	Algorithme<Portefeuille> rs = new RecuitSimule_PF(p, Double.parseDouble(tempDeterRS.getText()), Double.parseDouble(muDeterRS.getText()), Integer.parseInt(nBIterDeterRS.getText()), Integer.parseInt(nBPalierDeterRS.getText()));
    	try {
    		Solution s = rs.lancer();
    		afficherResDeterRS(s.getResultat(), s.getValeurs());
    		enableAll(true);
    	} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }                                    

    private void lancerCalculDeterContinue(java.awt.event.MouseEvent evt) {
    	enableAll(false);
    	recupererParamDeterRC();
/////////////////////////////////////////
//    	ici appeler la fonction de calcul de la relaxation continue deterministe
/////////////////////////////////////////
    	enableAll(true);
    }                                          

    //A UTILISER POUR OUVRIR ET FERMER getFichier()
    
    private void lancerCalculDeterLagrange(java.awt.event.MouseEvent evt) {
    	enableAll(false);
    	recupererParamDeterRL();
/////////////////////////////////////////
//    	ici appeler la fonction de calcul de la relaxation lagrangienne deterministe
/////////////////////////////////////////
    	enableAll(true);
    }                                                                        
   
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new IhmInterface().setVisible(true);
            }
        });
    }
    
    // Variables declaration    
    private  JMenu menuFichier;
    private  JMenu menuAPropos;
    private  JMenu menuAide;
    private  JMenuBar jMenuBar1;
    private  JMenuItem menuOuvrir;
    private  JMenuItem menuQuitter;

//////panneau stochastique
    private  JPanel panelStochastique;
    
    //analyse de scenario
    private  JPanel panelStochScenario;
    private  JList listeXiStochAS;
    private  JPanel panelStochScenarioParam;
    private  JPanel panelStochScenarioRes;
    private  JButton calculStochAS;
    private  JTextField nBScenarioStochAS;
    private  JTextField risqueStochAS;
    private  JTextField varStochAS;
    private  JTextField rStochAS ;
    private  JTextField mStochAS;
    private  JTextField alphaStochAS;
    
    //recuit simule
    private  JPanel panelStochRS;
    private  JPanel panelStochRSParam;
    private  JPanel panelStochRSRes;
    private  JList listeXiStochRS;
    private  JRadioButton choixSolNulleStochRS;
    private  JRadioButton choixGloutonStochRS;
    private  ButtonGroup buttonGroupStochRS;
    private  JButton calculStochRS;
    private  JTextField rStochRS;                 
    private  JTextField mStochRS;
    private  JTextField alphaStochRS;
    private  JTextField muStochRS;
    private  JTextField tempStochRS;
    private  JTextField nBPalierStochRS;
    private  JTextField nBIterStochRS;
    private  JTextField riskStochRS;
    private  JTextField varStochRS;
    
    //VNS
    private  JPanel panelStochVNS;
    private  JPanel panelStochVNSRes;
    private  JPanel panelStochVNSParam;
    private  JList listeXiStochVNS;
    private  JRadioButton choixSolNulleStochVNS;
    private  JRadioButton choixGloutonStochVNS;
    private  ButtonGroup buttonGroupStochVNS;
    private  JButton calculStochVNS;
    private  JTextField risqueStochVNS;
    private  JTextField varStochVNS;
    private  JTextField alphaStochVNS;
    private  JTextField mStochVNS;
    private  JTextField rStochVNS;
    private  JTextField condArretStochVNS;
    private  JTextField kMaxStochVNS;
    
    //relaxation continue
    private  JPanel panelStochContinu;
    private  JPanel panelStochContinuRes;
    private  JList listeXiStochRC;
    private  JPanel panelStochContinuParam;
    private  JButton calculStochRC;
    private  JTextField rStochRC;
    private  JTextField mStochRC;
    private  JTextField alphaStochRC;
    private  JTextField risqueStochRC;
    private  JTextField varStochRC;
    
    //relaxation lagrangienne
    private  JPanel panelStochLagrange;
    private  JPanel panelStochLagrangeParam;
    private  JPanel panelStochLagrangeRes;
    private  JList listeXiStochRL;
    private  JButton calculStochRL;
    private  JTextField rStochRL;
    private  JTextField mStochRL;
    private  JTextField alphaStochRL;
    private  JTextField risqueStochRL;
    private  JTextField varStochRL;
    
    //apercu
    private  JPanel panelStochApercuGraphe;
    private  JPanel panelStochApercu;
    
//////panneau deterministe
    private  JPanel panelDeterministe;
    
    //recuit simule
    private  JPanel panelDeterRS;
    
    //panel de parametrage
    private  JPanel panelDeterRSParam;
    private  JRadioButton choixSolNulleDeterRS;
    private  JRadioButton choixSolGloutonDeterRS;
    private  JTextField muDeterRS;
    private  ButtonGroup buttonGroupDeterRS;
    private  JButton calculDeterRS;
    private  JTextField epsilonDeterRS;
    private  JTextField kDeterRS;
    private  JTextField rDeterRS;
    private  JTextField deltaDeterRS;
    private  JTextField tempDeterRS;
    private  JTextField nBPalierDeterRS;
    private  JTextField nBIterDeterRS;
    
    //panel de resultat
    private  JTextField rendementDeterRS;
    private  JPanel panelDeterRSRes;
    private  JList listeYiDeterRS;
    private  JList listeXiDeterRS;
        
    //relaxation lagrangienne
    private  JPanel panelDeterLagrange;
    
//  panel de parametrage
    private  JPanel panelDeterLagrangeParam;
    private  JButton calculDeterRL;
    private  JTextField epsilonDeterRL;
    private  JTextField kDeterRL;
    private  JTextField rDeterRL;
    private  JTextField deltaDeterRL;
    
//  panel de resultat
    private  JPanel panelDeterLagrangeRes;
    private  JList listeYiDeterRL;
    private  JList listeXiDeterRL;    
    private  JTextField rendementDeterRL;
    
    //relaxation continue
    private  JPanel panelDeterContinu;
    
//  panel de parametrage
    private  JPanel panelDeterContinuParam;
    private  JButton calculDeterRC;
    private  JTextField kDeterRC;
    private  JTextField rDeterRC;
    private  JTextField epsilonDeterRC;
    private  JTextField deltaDeterRC;
    
//  panel de resultat
    private  JPanel panelDeterContinuRes;
    private  JList listeYiDeterRC;
    private  JList listeXiDeterRC;
    private  JTextField rendementDeterRC;
    
    //VNS
    private  JPanel panelDeterVNS;
    
    //panel de parametrage
    private  JPanel panelDeterVNSParam;
    private  JRadioButton choixSolNulleDeterVNS;
    private  JRadioButton choixGloutonDeterVNS;
    private  ButtonGroup buttonGroupDeterVNS;
    private  JButton calculDeterVNS;
    private  JTextField deltaDeterVNS;
    private  JTextField rDeterVNS;
    private  JTextField condArretDeterVNS;
    private  JTextField kMaxDeterVNS;
    private  JTextField kDeterVNS;
    private  JTextField epsilonDeterVNS;

    //  panel de resultat
    private  JPanel panelDeterVNSRes;
    private  JList listeYiDeterVNS;
    private  JList listeXiDeterVNS;
    private  JTextField rendementDeterVNS;
    
    //apercu de la frontiere
    private  JPanel panelDeterApercuGraphe;    
    private  JPanel panelDeterApercu;
    private  JLabel labelDeterApercu;
    
    //labels qui font joli mais qui servent a rien
    private  JLabel jLabel1;
    private  JLabel jLabel10;
    private  JLabel jLabel11;
    private  JLabel jLabel12;
    private  JLabel jLabel13;
    private  JLabel jLabel14;
    private  JLabel jLabel15;
    private  JLabel jLabel16;
    private  JLabel jLabel17;
    private  JLabel jLabel18;
    private  JLabel jLabel19;
    private  JLabel jLabel2;
    private  JLabel jLabel20;
    private  JLabel jLabel21;
    private  JLabel jLabel22;
    private  JLabel jLabel23;
    private  JLabel jLabel24;
    private  JLabel jLabel25;
    private  JLabel jLabel26;
    private  JLabel jLabel27;
    private  JLabel jLabel28;
    private  JLabel jLabel29;
    private  JLabel jLabel3;
    private  JLabel jLabel30;
    private  JLabel jLabel31;
    private  JLabel jLabel32;
    private  JLabel jLabel33;
    private  JLabel jLabel34;
    private  JLabel jLabel35;
    private  JLabel jLabel36;
    private  JLabel jLabel37;
    private  JLabel jLabel38;
    private  JLabel jLabel39;
    private  JLabel jLabel4;
    private  JLabel jLabel40;
    private  JLabel jLabel41;
    private  JLabel jLabel42;
    private  JLabel jLabel43;
    private  JLabel jLabel44;
    private  JLabel jLabel45;
    private  JLabel jLabel46;
    private  JLabel jLabel47;
    private  JLabel jLabel48;
    private  JLabel jLabel49;
    private  JLabel jLabel5;
    private  JLabel jLabel50;
    private  JLabel jLabel51;
    private  JLabel jLabel52;
    private  JLabel jLabel53;
    private  JLabel jLabel54;
    private  JLabel jLabel55;
    private  JLabel jLabel56;
    private  JLabel jLabel57;
    private  JLabel jLabel58;
    private  JLabel jLabel59;
    private  JLabel jLabel6;
    private  JLabel jLabel60;
    private  JLabel jLabel61;
    private  JLabel jLabel62;
    private  JLabel jLabel63;
    private  JLabel jLabel64;
    private  JLabel jLabel65;
    private  JLabel jLabel66;
    private  JLabel jLabel67;
    private  JLabel jLabel68;
    private  JLabel jLabel69;
    private  JLabel jLabel7;
    private  JLabel jLabel70;
    private  JLabel jLabel71;
    private  JLabel jLabel72;
    private  JLabel jLabel73;
    private  JLabel jLabel74;
    private  JLabel jLabel75;
    private  JLabel jLabel76;
    private  JLabel jLabel77;
    private  JLabel jLabel78;
    private  JLabel jLabel79;
    private  JLabel jLabel8;
    private  JLabel jLabel80;
    private  JLabel jLabel81;
    private  JLabel jLabel82;
    private  JLabel jLabel83;
    private  JLabel jLabel84;
    private  JLabel jLabel85;
    private  JLabel jLabel86;
    private  JLabel jLabel9;

    //autre
    private  JScrollPane jScrollPane1;
    private  JScrollPane jScrollPane10;
    private  JScrollPane jScrollPane11;
    private  JScrollPane jScrollPane12;
    private  JScrollPane jScrollPane13;
    private  JScrollPane jScrollPane2;
    private  JScrollPane jScrollPane3;
    private  JScrollPane jScrollPane4;
    private  JScrollPane jScrollPane5;
    private  JScrollPane jScrollPane6;
    private  JScrollPane jScrollPane7;
    private  JScrollPane jScrollPane8;
    private  JScrollPane jScrollPane9;
    private  JTabbedPane jTabbedPane1;
    private  JTabbedPane jTabbedPane2;
    private  JTabbedPane jTabbedPane3;

}
